package com.lcz.stockanalysis.utils;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.view.View;

import com.lcz.stockanalysis.activity.BaseApplication;


public class UiUtils {
    /**
     * 获取到字符数组
     *
     * @param tabNames 字符数组的id
     */
    public static String[] getStringArray(int tabNames) {
        return getResource().getStringArray(tabNames);
    }

    /* 获取资源 */
    public static Resources getResource() {
        return BaseApplication.getApplication().getResources();
    }

    /* 获取上下文 */
    public static Context getContext() {
        return BaseApplication.getApplication();
    }

    /* 关联布局 */
    public static View inflate(int id) {
        return View.inflate(getContext(), id, null);
    }

    /*引用图片资源*/
    public static Drawable getDrawalbe(int id) {
        return getResource().getDrawable(id);
    }
}
